package com.wms.controller;

import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 阿盛哟
 * @description :
 * @createDate : 2025/7/1 16:33
 */
@RestController
@Slf4j
public class Hello {

    @Resource(name = "chatModelQWen")
    private ChatModel chatModel;

    @GetMapping("langchain4j/hello")
    public String hello(@RequestParam(value = "question",defaultValue = "hello,你是谁") String question) {

        String result = chatModel.chat(question);
        System.out.println("调用大模型回复："+result);
        return result;
    }
}